package com.stu.disruptor.service;

import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.WorkHandler;

public abstract class DisruptorConsumer<T> implements EventHandler<ObjectEvent<T>>, WorkHandler<ObjectEvent<T>> {
    public DisruptorConsumer() {
    }

    @Override
    public void onEvent(ObjectEvent<T> event, long sequence, boolean endOfBatch) throws Exception {
        this.onEvent(event);
    }

    @Override
    public void onEvent(ObjectEvent<T> event) throws Exception {
        this.consumer(event.getObj());
    }
 
    public abstract void consumer(T var1);
}